package com.ibeifeng.io;

import java.io.IOException;
import java.io.InputStream;

public class TestInputStream {
	public static void main(String[] args) {
		try {
			InputStream is = System.in;
			while(true){
				byte[] buf = new byte[1024];
				int len = 0;
				while((len=is.read(buf))>0){
					String str = new String(buf,0,len);
					if("exit".equals(str.trim())){
						System.out.println("лл~");
						System.exit(0);
					}
					System.out.write(buf,0,len);
				}
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
